var
    session = require('express-session'),
    redisStore = require('connect-redis')(session),
//crypto = require('crypto');
//console.log(crypto.createHash('md5').update("123456789").digest('hex').toUpperCase());
    sessionConf = new function () {
        var conf = {
            "alpha": {
                secret: '1234567890',
                name: 'nodejs-manager',
                cookie: {maxAge: 1000 * 60 * 30},//30分钟过期
                resave: false,
                saveUninitialized: true,
                store: new redisStore({host: "121.42.143.200", port: 6379, db: 0})
            },
            "ga": {
                secret: '1234567890',
                name: 'nodejs-manager',
                cookie: {maxAge: 1000 * 60 * 30},//30分钟过期
                resave: false,
                saveUninitialized: true,
                store: new redisStore({host: "121.42.143.200", port: 6379, db: 0})
            }
        };
        this.config = function () {
            if (process.env && process.env.MANAGER_CONFIG) {
                return conf[process.env.MANAGER_CONFIG];
            }
            return session(conf.alpha);
        }
    }
module.exports = sessionConf;